<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
	<title><?php echo PAGETITLE; ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="lang" content="es" />
	<meta name="robots" content="noindex,nofollow" />
	<link rel="stylesheet" type="text/css" media="screen" href="includes/styles.css" />
	<script type="text/javascript" src="includes/jquery-1.7.min.js"></script>
	<script type="text/javascript" src="includes/functions.js"></script>
</head>

<body>

<table cellspacing="0" cellpadding="0" width="100%" height="100%">

	<tr height="20">
		<td width="20" style="background: url(images/bkg_tl.gif) no-repeat right bottom; font-size: 1px"></td>
		<td>
			<table cellspacing="0" cellpadding="0" width="100%" height="100%">
				<tr height="100%">
					<td width="10" style="background: url(images/bkg_tlt.gif) no-repeat left bottom; font-size: 1px">&nbsp;</td>
					<td style="background: url(images/bkg_t.gif) repeat-x left bottom; font-size: 1px">&nbsp;</td>
					<td width="10" style="background: url(images/bkg_trt.gif) no-repeat right bottom; font-size: 1px">&nbsp;</td>
				</tr>
			</table>
		</td>
		<td width="20" style="background: url(images/bkg_tr.gif) no-repeat left bottom; font-size: 1px">&nbsp;</td>
	</tr>

	<tr valign="top">

		<td width="20" height="100%">
			<table cellspacing="0" cellpadding="0" width="100%" height="100%">
				<tr height="10"><td style="background: url(images/bkg_tll.gif) no-repeat right top; font-size: 1px">&nbsp;</td></tr>
				<tr><td style="background: url(images/bkg_l.gif) repeat-y right top; font-size: 1px">&nbsp;</td>
				<tr height="10"><td style="background: url(images/bkg_bll.gif) no-repeat right bottom; font-size: 1px">&nbsp;</td></tr>
			</table>
		</td>

		<td bgcolor="#ffffff">
			<table cellspacing="0" cellpadding="0" width="100%" height="100%" style="border-width: 1px; border-style: solid; border-color: #ffffff">

				<tr height="45">
					<td class="mainTitle">
						Terapia del Dolor
					</td>
					<td width="1%" class="date" align="right">
						<?=$_SESSION["diassemana"][date("w")]?><br><?=date("j")?> <?=strtoupper(substr($_SESSION["meses"][date("n")], 0, 3))?> <?=date("Y")?>
					</td>
				</tr>

				<tr height="6"><td colspan="2" class="lightBlue">&nbsp;</td></tr>
				<tr height="10"><td colspan="2" class="headerImage">&nbsp;</td></tr>

				<tr valign="top" height="100%"><td colspan="2">
					<table cellspacing="0" cellpadding="0" width="100%" height="100%">

						<tr valign="top">

							<?php
							if ($section != "login" && $section != "notlogged")
							{
								echo "<td id=\"leftColumn\">\n";

								if (isset($_SESSION["user"]) && $_SESSION["user"] != "")
								{
									echo "<div id=\"userBox\" style=\"float: left;\">\n";
									echo "<div style=\"float: left;\">Bienvenid@ <b>".$_SESSION["username"]."</b></div>\n";
									echo "<div style=\"width: 70%; float: left; clear: left;\"><input type=\"button\" name=\"disconnect\" value=\"Desconectar\" class=\"disconnect\" onclick=\"self.location.href = 'logout.php';\"></div>\n";
									echo "<div style=\"width: 30%; float: right; text-align: right;\"><a href=\"mensajes.php\"><img src=\"images/ico_mail.png\" alt=\"\" /></a></div>\n";
									echo "</div>\n";
								}

								echo "<div id=\"menu\" style=\"float: left; clear: left;\">\n";
								echo "<div class=\"epigraph\">Pacientes&nbsp;&nbsp;</div>\n";
								echo "<ul>\n";
								echo "<li><a href=\"fichapaciente.php\">Nuevo paciente</a></li>\n";
								echo "<li><a href=\"listpacientes.php\">Listado de pacientes</a></li>\n";
								echo "<li><a href=\"buscapacientes.php\">B&uacute;squeda por par&aacute;metros</a></li>\n";
								echo "</ul>\n";
								echo "<div class=\"epigraph\">Estad&iacute;sticas</div>\n";
								echo "<ul>\n";
								echo "<li><a href=\"porcentajes.php\">Porcentajes</a></li>\n";
								echo "</ul>\n";
								echo "<div class=\"epigraph\">Administraci&oacute;n&nbsp;&nbsp;</div>\n";
								echo "<ul>\n";
								echo "<li><a href=\"listaseguradoras.php\">Compa&ntilde;&iacute;as aseguradoras</a></li>\n";
								echo "<li><a href=\"listalergias.php\">Alergias</a></li>\n";
								echo "<li><a href=\"listantecmedic.php\">Antecedentes personales</a></li>\n";
								echo "<li><a href=\"listantecquirur.php\">Antecedentes quir&uacute;rgicos</a></li>\n";
								echo "<li><a href=\"listtratamhabit.php\">Tratamientos habituales</a></li>\n";
								echo "<li><a href=\"listdiagnos.php\">Diagn&oacute;sticos</a></li>\n";
								echo "<li><a href=\"listplanterapeut.php\">Planes terap&eacute;uticos</a></li>\n";
								echo "<li><a href=\"listtratamfarma.php\">Tratamientos farmacol&oacute;gicos</a></li>\n";
								echo "<li><a href=\"listtrataminvas.php\">Tratamientos invasivos</a></li>\n";
								echo "<li><a href=\"listexplorcom.php\">Exploraciones complementarias</a></li>\n";
								echo "</ul>\n";
								echo "</div>\n";

								echo "</td>\n";
							}
							?>

							<td id="content">
								<div class="title"><?=$sectiondes?></div>
